home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / MENU_UTL / SLMENU / SLMENU.DOC next >
Text File  |  1991-06-29  |  3KB  |  72 lines

  1. SLMenu.TPU v1.0    by David Sward
  2. ─═─═─═─═─═─═─═─═─═─═─═─═─═─═─═─═─═─═─═─═─═─═─═─═─═─═─═─═─═─═─═─═─═─═─═─═─═─═─═─
  3.  
  4. This unit (SLMENU5.TPU for TP5.5 & SLMENU6.TPU for TP6.0) is designed to let
  5. the programmer worry about the program itself, not the interface so much.  This
  6. unit lets the programmer specify the commands to use and the unit will show
  7. either a lightbar or the single word according to the procedure called.  It
  8. even supports Help which is temporarily added to the command list for internal
  9. usage (therefore, DO NOT define a Help command if you are going to use the
  10. single-word menu).  The menu displayed are very close to what Searchlight
  11. uses, but I decided on the changes, not that I couldn't make them identical.
  12. <grin>
  13.  
  14. Usage:
  15.  
  16. uses SLMenu5;
  17. (* I use Turbo Pascal 5.5, hate the 6.0 IDE                                  *)
  18.  
  19. var m:tMenu;
  20. (* Define a menu                                                             *)
  21.     k:char;
  22. (* Define the character for the result of the menu                           *)
  23.  
  24. begin
  25.   uses_Color := TRUE;
  26. (* Either TRUE or FALSE (since it's a boolean), there is no monochrome mode  *)
  27.  
  28.   help_Default := TRUE;
  29. (* Either TRUE or FALSE (ditto), this will determine if the help lines are   *)
  30. (* shown, just like Searchlight in both Color(Mono) and None modes...        *)
  31.  
  32.   clearMenu(m);
  33. (* Clear the memory used by the menu to remove all trash                     *)
  34.  
  35.   addCommand(m,'List','List available subboards');
  36. (* Add the List command with it's help line to the menu                      *)
  37. (* Note:  The commands can only be up to 10 characters long and the help     *)
  38. (*        lines only 25 characters                                           *)
  39.  
  40.   addCommand(m,'Goodbye','Logoff the BBS');
  41. (* Add the Goodbye command with it's help line to the menu                   *)
  42.  
  43.   setMenu(m,'Bit Stream BBS','Main Menu: ','L',3,TRUE);
  44. (* Set the title, prompt, default command, color of the prompt and the help  *)
  45. (* setting of the menu.  The Title and prompt can only be 25 characters, the *)
  46. (* default command is actually the key used to select the command, the color *)
  47. (* is the color the prompt will be displayed with, and the help setting is   *)
  48. (* whether or not help will be available for the menu.. If not, then the     *)
  49. (* [?=Help] prompt won't even be shown with menuBar, and none of the help    *)
  50. (* lines will be shown... But the Help command will still be available in    *)
  51. (* menuWord... The title is used for Help when using menuWord, and prompt is *)
  52. (* what is displayed on the line but before the actual commands              *)
  53.  
  54.   sortMenu(m);
  55. (* Make sure all the commands are in order by select key                     *)
  56.  
  57.   k := menuBar(m);
  58. (* Run the lightbar menu procedure and put the select key of the command in  *)
  59. (* k...                                                                      *)
  60.  
  61.   k := menuWord(m);
  62. (* Run the single-word menu and put the result into k                        *)
  63.  
  64.   killCommand(m,'Goodbye');
  65. (* Remove the Goodbye command from the menu.. <heh heh>                      *)
  66.  
  67. end.
  68.  
  69. This demo should actually run <grin>... Enjoy
  70.  
  71. David Sward
  72.